#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.demo.config;

import ${package}.demo.config.interceptor.ReactInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author liuxw
 * @date 2019/4/1
 * @since 1.0
 */
@Configuration
public class ReactWebConfig implements WebMvcConfigurer {

    /**
     * 添加拦截器
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        //需要添加多个拦截器的话，调用addInterceptor()多次即可
        registry.addInterceptor(new ReactInterceptor())
                //拦截器要拦截的url规则
                .addPathPatterns("/product/save")
                //拦截器屏蔽的url规则
                //.excludePathPatterns("/usr")
                //拦截器的执行顺序
                .order(1);
    }

}
